<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<html lang="en">
<head>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <title>订牛奶管理系统</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" href="/static/lib/bootstrap5.0.0/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/stylesheets/theme.css">
    <link rel="stylesheet" href="/static/lib/font-awesome/css/font-awesome.css">
    <script src="/static/lib/jquery-1.8.3.min.js" charset="UTF-8" type="text/javascript"></script>
    <script src="/static/js/dictionary/save.js" charset="UTF-8" type="text/javascript"></script>


    <style type="text/css">
        #title {
            text-align: center;
            text-decoration: underline;
            font-family: cursive;
            color: red;
            font-size: 1.9em;
        }
    </style>
</head>

<body>
<%@ include file="../top.jsp" %>
<%@ include file="../left.jsp" %>


<div class="content">
    <div class="header">
        <h1 class="page-title" id="title">字典管理</h1>
    </div>

    <div class="container">
        <div class="panel panel-default">
            <form action="/dictionary/saveAndEdit" method="post">
                <input name="id" id="id" class="form-control" type="hidden" value="${dictionary.id}">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-6">
                            <span for="name">分类名称：</span>
                            <input name="name" id="name" class="form-control" value="${dictionary.name}">
                        </div>

                        <div class="col-md-6">
                            <span for="reporter">结构类型：</span>
                            <select name="type" class="type" id="type">
                                <option ${dictionary.type == 1 ? "selected" : ""} class='' value="1">列表结构</option>
                                <option ${dictionary.type == 2 ? "selected" : ""} class='' value="2">树形结构</option>
                            </select>
                        </div>
                        <div class="col-md-12">
                            <label for="company">所属系统：</label>
                            <input name="company" id="company" class="form-control" value="${dictionary.company}">
                        </div>

                        <div class="col-md-12">
                            <label for="dicCode">字典代码：</label>
                            <textarea name="dicCode" id="dicCode" class="form-control">${dictionary.dicCode}</textarea>
                        </div>

                        <div class="col-md-12">
                            <label for="notes">备注：</label>
                            <textarea name="notes" id="notes" class="form-control">${dictionary.notes}</textarea>
                        </div>

                        <div class="col-md-12" style="text-align: center;">
                            <button type="button" onclick="saveAndEdit()" class="btn btn-primary">提交</button>
                            <button type="button" onclick="cancel()" class="btn btn-primary">取消</button>
                        </div>

                    </div>
                </div>
            </form>
        </div>
    </div>

</div>
<script src="/static/lib/bootstrap5.0.0/js/bootstrap.bundle.min.js"></script>
<script src="/static/lib/My97DatePicker/WdatePicker.js"></script>
</body>
</html>
